addItem Method (Context Menu) |
This method adds a menu item with a unique identifier to the context menu.
Syntax
oMenuItem = contextMenuID.addItem(sId, fpMethod, sContent [, bEnable] [, sInsertBeforeI])
Parameters
Parameter |
Description |
---|---|
sID |
Required. String that specifies the unique identifier of the menu item created. |
fpMethod |
Required. Pointer that specifies the function to call when the menu item is clicked. |
sContent |
Required. String that specifies the content of the menu item. It can be any valid HTML. |
sEnable |
Optional. String that specifies whether the menu item is to be enabled or disabled. Takes the valuetrueorfalse.
|
sInsertBeforeId |
Optional. String that specifies the menu item or separator or the ID of the menu item or separator above which the new menu item is to be added.When not specified, the menu item is added as the last item. |
Return Value
Returns an object which is the menu item that is created.